import Data from './schema';

do { os::open-read-only (os::EntryModuleDirPath join ['sample','sample1.kmd']) }
    . { then &(file) =>
        file
            . { read-all }
            . { then &(binary) =>
                let result: Result[Data::Canvas,Error] :=
                    { Data::@deserialize binary },
                switch result:
                case Success canvas:
                    let _ := { trace canvas },
                    { os::println 'Deserialization Finished' },
                case Failure err:
                    { os::println { "Deserialization Error: ?" err.{String} } },
                end
            } }
    . { crash-on-error };
